package DieSiedler;

public class Koordinate {
	
	public int x;
	
	public int y;
	
	
	public Koordinate(){
		
	}

	public Koordinate(int x, int y){
		this.x = x;
		this.y = y;
	}
	
	public boolean valid(){
		if(x >= 0 && y >= 0){
			return true;
		}
		return false;
	}
	
	public void print(){
		System.out.println("X: "+x+", Y: "+y);
	}
        
        public boolean equals(Object o){
            try{
                Koordinate k = (Koordinate)o;
                if(k.x == x && k.y == y){
                    return true;
                }
            }catch(Exception e){
                
            }            
            return false;
        }
        
        
        public int hashCode(){
            return (x * 2) + (y * 11);
        }
        
}
